package com.yael.utils;

public class MyTimer {

	private long _time;

	public MyTimer(){
		_time = System.currentTimeMillis();
	}
	
	public String stop() {
		long currTime = (System.currentTimeMillis() - _time) / 1000;
		String seconds = Integer.toString((int) (currTime % 60));
		String minutes = Integer.toString((int) ((currTime % 3600) / 60));
		String hours = Integer.toString((int) (currTime / 3600));
		for (int i = 0; i < 2; i++) {
			if (seconds.length() < 2) {
				seconds = "0" + seconds;
			}
			if (minutes.length() < 2) {
				minutes = "0" + minutes;
			}
			if (hours.length() < 2) {
				hours = "0" + hours;
			}
		}
		return hours + ":" + minutes + ":" + seconds;
	}
}
